<template>
  <div class="tablePageWarp">
    <!-- 搜索区域 -->
    <div class="tableListSearch">
      <dictionary-search ref="dictionarySearch" @clickBtn="query" :ids="ids" @change="query" @addeDict="addeDict"/>
    </div>
    <!-- 列表区域 -->
    <div class="tableListMain commonTableSty">
      <dictionary-list ref="dictionaryCompt" @bulkDeletion="bulkDeletion"></dictionary-list>
    </div>
    <!-- 新增字典弹窗 -->
    <add-form-modal
      ref="showDictpopups"
      @refreshDictCode="refreshDictCode"
    >
    </add-form-modal>
  </div>
</template>
<script>
import DictionaryList from './components/DictionaryList.vue'
import DictionarySearch from './components/DictionarySearch.vue'
import AddFormModal from '@/views/dictionary/components/AddFormModal.vue'
export default {
  components: {
    DictionaryList,
    DictionarySearch,
    AddFormModal
  },
  data () {
    return {
      ids:[]
    }
  },
  methods: {
    // 刷新表格
    flushed () {
      this.$refs.dictionaryCompt.refreshData(true)
    },
    // 清空勾选
    clearCheckbox () {
      this.$refs.dictionaryCompt.emptyTableSelction()
    },

    bulkDeletion (val) {
      this.ids = val
    },
    query () {
      this.$refs.dictionaryCompt.refreshData()
    },
    addeDict () {
      this.$refs.showDictpopups.switchVisible()
    },
    refreshDictCode () {
      console.log('刷新成功')
      this.$refs.dictionarySearch.getDictCode()
    }
  }
}
</script>
<style scoped></style>
